
The HPC dispatcher module
array, a matrix), the given function (i.e., the mapping function) are evaluated for each el-
ement of the input sequence. uq_map returns the results from each evaluation; the results
always have the same number of elements as in the input sequence. Using uq_map is an
alternative to using a for-loop for the same evaluations; it evaluates the mapping function
on a sequence of inputs one element at a time
2
.
uq_map is a generic UQLAB function and it works with or without the DISPATCHER module.
When used in conjunction with the DISPATCHER module, however, the function evaluations
can be dispatched to a remote machine and executed in parallel
3
. This command is particu-
larly useful to dispatch user-defined functions that wrap around other UQLAB functionalities
to be executed on the remote machine(s). Section 2.4 provides an example of using uq_map
coupled with the DISPATCHER module to carry out a parametric study.
Note: The reader is referred to the uq_map chapter of the UQLib User Manual
(Moustapha et al., 2021) for a reference on using uq_map without the DIS-
PATCHER module. In fact, some familiarity with uq_map before dispatching it
to the remote machine is recommended.
1.3.2 Dispatching a computation
To dispatch a computation with any of the dispatcher-aware commands, a user must first
configure and create a DISPATCHER object. Once the DISPATCHER object has been successfully
created, the user dispatches the computation by calling a dispatcher-aware command.
This workflow is shown in Figure 5, along with an illustration of what happens behind the
scenes. It shows that although the DISPATCHER object performs many intermediate tasks to
dispatch a computation to a remote machine, only few steps are required from the user.
After the computation is dispatched, an updated DISPATCHER object is returned to the user
regardless of the remote job execution outcome. As mentioned in Section 1.2, while the
remote job execution, in principle, happens asynchronously to the local UQLAB session, it is
synchronized with the local UQLAB session (see Section 1.3.4 for details).
1.3.3 Keeping track of a dispatched computation
Once the computation is dispatched, its execution happens on the remote machine, and
the final results will also be stored in there. As shown in Figure 5, the notion of JOB is
central to the DISPATCHER module. In UQLAB/DISPATCHER terminology, a JOB refers to a
distinct computation executed on the remote machine(s). Users keep track of dispatched
computations by managing these JOBs from their local UQLAB session.
2
As a side note, a map function is a functional programming style’s take on specific programmatic tasks
that typically involve for-loops. uq_map borrows its name from a similar function available in several other
programming languages, including R and Python.
3
A similar parallelization can be also achieved by using a parfor-loop, a MATLAB programming construct
that requires a special toolbox.
UQLAB-V2.0-116 - 7 -